rm(list = ls())

## 

library(tidyverse)
library(readxl)

## 

man <- read_excel('data/MPDataset_MPDS2019b.xlsx') %>% 
  filter(countryname == 'Germany') %>% 
  mutate(year = lubridate::year(edate)) %>% 
  filter(year %in% c(2013, 2017)) %>% 
  dplyr::select(partyabbrev, matches('414'), year) %>% 
  filter(!is.na(partyabbrev)) %>% 
  mutate(year = as.character(year)) %>% 
  filter(!partyabbrev == 'AfD') %>% 
  filter(year == 2017) %>% 
  mutate(partyabbrev = dplyr::recode(partyabbrev,
                                     `LINKE` = 'Left party',
                                     `90/Greens` = 'Greens')) %>% 
  mutate(partyabbrev = fct_reorder(partyabbrev, per414))

# Figure 1: Manifesto data ----

p1 <- ggplot(man, aes(partyabbrev, per414, year)) +
  geom_bar(width = 0.8, fill = 'grey97', 
           color = 'black', stat = 'identity') +
  theme_bw() +
  coord_flip() +
  ylab('Support for balanced budgets and reduced spending\n(Based on party manifestos, 2017)') +
  theme(axis.title.y = element_blank())
p1

